import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextContainer {
    public static <MyBean> void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        //使用context获取bean
        MyBean myBean = (MyBean) context.getBean("myBean");
    }
}
